3.32 \(\int \sin (e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=28 \[ \frac{b \sec (e+f x)}{f}-\frac{(a-b) \cos (e+f x)}{f} \]

[Out]

-(((a - b)*Cos[e + f*x])/f) + (b*Sec[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0261331, antiderivative size = 28, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {3664, 14} \[ \frac{b \sec (e+f x)}{f}-\frac{(a-b) \cos (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-(((a - b)*Cos[e + f*x])/f) + (b*Sec[e + f*x])/f

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \sin (e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a-b+b x^2}{x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b+\frac{a-b}{x^2}\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{(a-b) \cos (e+f x)}{f}+\frac{b \sec (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0435174, size = 46, normalized size = 1.64 \[ \frac{a \sin (e) \sin (f x)}{f}-\frac{a \cos (e) \cos (f x)}{f}+\frac{b \cos (e+f x)}{f}+\frac{b \sec (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cos[e]*Cos[f*x])/f) + (b*Cos[e + f*x])/f + (b*Sec[e + f*x])/f + (a*Sin[e]*Sin[f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 52, normalized size = 1.9 \begin{align*}{\frac{1}{f} \left ( -\cos \left ( fx+e \right ) a+b \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{\cos \left ( fx+e \right ) }}+ \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*(-cos(f*x+e)*a+b*(sin(f*x+e)^4/cos(f*x+e)+(2+sin(f*x+e)^2)*cos(f*x+e)))

________________________________________________________________________________________

Maxima [A]  time = 0.950032, size = 42, normalized size = 1.5 \begin{align*} \frac{b{\left (\frac{1}{\cos \left (f x + e\right )} + \cos \left (f x + e\right )\right )} - a \cos \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

(b*(1/cos(f*x + e) + cos(f*x + e)) - a*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.79394, size = 65, normalized size = 2.32 \begin{align*} -\frac{{\left (a - b\right )} \cos \left (f x + e\right )^{2} - b}{f \cos \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a - b)*cos(f*x + e)^2 - b)/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \sin{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*sin(e + f*x), x)

________________________________________________________________________________________

Giac [A]  time = 1.42117, size = 55, normalized size = 1.96 \begin{align*} b{\left (\frac{\cos \left (f x + e\right )}{f} + \frac{1}{f \cos \left (f x + e\right )}\right )} - \frac{a \cos \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

b*(cos(f*x + e)/f + 1/(f*cos(f*x + e))) - a*cos(f*x + e)/f